// Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi space 
// Source File Name:   StaffDepartmentDTO.java

package com.hfstu.pms.dto;

import com.hfstu.pms.model.*;
import java.lang.reflect.InvocationTargetException;
import org.apache.commons.beanutils.BeanUtils;

public class StaffDepartmentDTO
{

	private String id;
	private String staffId;
	private String staffName;
	private String deptId;
	private String deptName;
	private String userId;

	public StaffDepartmentDTO()
	{
	}

	public String getUserId()
	{
		return userId;
	}

	public void setUserId(String userId)
	{
		this.userId = userId;
	}

	public String getId()
	{
		return id;
	}

	public void setId(String id)
	{
		this.id = id;
	}

	public String getStaffId()
	{
		return staffId;
	}

	public void setStaffId(String staffId)
	{
		this.staffId = staffId;
	}

	public String getStaffName()
	{
		return staffName;
	}

	public void setStaffName(String staffName)
	{
		this.staffName = staffName;
	}

	public String getDeptId()
	{
		return deptId;
	}

	public void setDeptId(String deptId)
	{
		this.deptId = deptId;
	}

	public String getDeptName()
	{
		return deptName;
	}

	public void setDeptName(String deptName)
	{
		this.deptName = deptName;
	}

	public StaffDepartmentDTO transfer(StaffDepartment staffDepartment)
	{
		try
		{
			BeanUtils.copyProperties(this, staffDepartment);
		}
		catch (IllegalAccessException e)
		{
			e.printStackTrace();
		}
		catch (InvocationTargetException e)
		{
			e.printStackTrace();
		}
		if (staffDepartment.getStaff() != null)
		{
			setStaffId(staffDepartment.getStaff().getId());
			setStaffName(staffDepartment.getStaff().getName());
			setUserId(staffDepartment.getStaff().getUser() == null ? "" : staffDepartment.getStaff().getUser().getId());
		}
		if (staffDepartment.getDepartment() != null)
		{
			setDeptId(staffDepartment.getDepartment().getId());
			setDeptName(staffDepartment.getDepartment().getName());
		}
		return this;
	}
}
